package com.geek.ch03.game;

/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/3
 */
public abstract class Role {

    private String name;
    private int level;
    private int blood;
    private String kind;
    private int power;
    private int defence;

    //抽象攻击方法方法
    public abstract void attack(Role role);

    //死亡判定方法,返回true代表死亡，flase代表存活
    public  boolean isDead(){
        if(this.blood<=0){
            return true;
        }
        return false;
    }
    //获取角色信息方法
    public void show(){
        System.out.println("名称：" + this.name);
        System.out.println("等级：" + this.level);
        System.out.println("血量：" + this.blood);
        System.out.println("种类：" + this.kind);
        System.out.println("攻击力：" + this.power);
        System.out.println("防御力：" + this.defence);
    }




    public Role() {
    }

    public Role(String name, int level, int blood, String kind, int power, int defence) {
        this.name = name;
        this.level = level;
        this.blood = blood;
        this.kind = kind;
        this.power = power;
        this.defence = defence;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return level
     */
    public int getLevel() {
        return level;
    }

    /**
     * 设置
     * @param level
     */
    public void setLevel(int level) {
        this.level = level;
    }

    /**
     * 获取
     * @return blood
     */
    public int getBlood() {
        return blood;
    }

    /**
     * 设置
     * @param blood
     */
    public void setBlood(int blood) {
        this.blood = blood;
    }

    /**
     * 获取
     * @return kind
     */
    public String getKind() {
        return kind;
    }

    /**
     * 设置
     * @param kind
     */
    public void setKind(String kind) {
        this.kind = kind;
    }

    /**
     * 获取
     * @return power
     */
    public int getPower() {
        return power;
    }

    /**
     * 设置
     * @param power
     */
    public void setPower(int power) {
        this.power = power;
    }

    /**
     * 获取
     * @return defence
     */
    public int getDefence() {
        return defence;
    }

    /**
     * 设置
     * @param defence
     */
    public void setDefence(int defence) {
        this.defence = defence;
    }

    public String toString() {
        return "Role{name = " + name + ", level = " + level + ", blood = " + blood + ", kind = " + kind + ", power = " + power + ", defence = " + defence + "}";
    }
}
